<div id="wrapper-edit-popup">
	<div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none; ">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			<h3 id="myModalLabel">Edit this Expense Transaction</h3>
		</div>
		<div class="modal-body clearfix">
			<p>Checking if this is coming</p>
			<?php //dsm($data); ?>
      <?php
      $this->load->helper('html');
      $this->load->helper('form');

			// Building the array for the drop down for expense category.
      $category = array();
      $category['0'] = 'SELECT';
      $category_array = $this->global_model->global_get_categories('expense');
      
      // Populating the $category array with the query result.
      foreach ($category_array as $value) {
        $category[$value['cid']] = $value['name'];
      }
      
      print form_open('transactions/edit_expense');

			print form_hidden('expense_id',$data[0]->eid);
			print form_hidden('termid',$data[0]->termid);

      print form_label('Transaction date:');
      print form_input('date',$data[0]->date,'id="datepicker"');
      
      print form_label('Particulars:');
      print form_input('particulars',$data[0]->description);
      
      print form_label('Transaction Amount:');
      print form_input('amount',$data[0]->famount);
      
      print form_label('Select a category:');
      print form_dropdown('category',$category, $data[0]->cid,'id="category-selector"');
      ?>
			<div id="sub-cat-holder">
			<?php
			$sub_category = array($data[0]->name);
			print form_dropdown('category',$sub_category,$data[0]->name,'id="category-selector"');
			?>
			</div>
			<?php
			print br();
			print form_submit('save', 'Save', 'class="btn btn-large btn-success"');

			print form_close();
			?>
		</div>
		<div class="modal-footer">
			<br /><br />
			<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
		</div>
	</div>
</div>